package com.ethink.order.facadeImpl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.SaleReturnOrderFacade;
import com.ethink.order.api.info.SaleReturnDetailOrderInfo;
import com.ethink.order.api.model.SaleReturnModeModel;
import com.ethink.order.api.model.SaleReturnModel;
import com.ethink.order.api.request.SaleReturnOrderAddRequest;
import com.ethink.order.api.request.SaleReturnOrderQueryModeRequest;
import com.ethink.order.api.request.SaleReturnOrderQueryRequest;
import com.ethink.order.api.request.SaleReturnOrderUpdateRequest;
import com.ethink.order.api.response.SaleReturnOrderAddResponse;
import com.ethink.order.api.response.SaleReturnQueryDetailResponse;
import com.ethink.order.service.SaleReturnDetailOrderService;
import com.ethink.order.service.SaleReturnOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 销售退单 Facade接口实现
 *
 * @author default
 * @date 2022-12-09
 */
@RestController
@Slf4j
@RequestMapping("order-service/facade/v1/saleReturnOrder")
public class SaleReturnOrderFacadeImpl implements SaleReturnOrderFacade {

    @Autowired
    private SaleReturnOrderService saleReturnOrderService;

    @Autowired
    private SaleReturnDetailOrderService saleReturnDetailOrderService;

    @Override
    public SaleReturnOrderAddResponse add(SaleReturnOrderAddRequest request) {
        return saleReturnOrderService.add(request);
    }

    @Override
    public Page<SaleReturnModel> pageQuery(SaleReturnOrderQueryRequest request) {
        return saleReturnOrderService.pageQuery(request);
    }

    @Override
    public SaleReturnQueryDetailResponse queryDetail(Long id) {
        return saleReturnOrderService.queryDetail(id);
    }

    @Override
    public Boolean update(SaleReturnOrderUpdateRequest request) {
        return saleReturnOrderService.update(request);
    }

    @Override
    public Boolean delete(Long id) {
        return saleReturnOrderService.delete(id);
    }

    @Override
    public Boolean pass(Long id) {
        return saleReturnOrderService.pass(id);
    }

    @Override
    public Boolean refuse(Long id) {
        return saleReturnOrderService.refuse(id);
    }

    @Override
    public List<SaleReturnDetailOrderInfo> queryDetailListBySaleOrderNo(String saleOrderNo) {
        return saleReturnDetailOrderService.queryDetailListBySaleOrderNo(saleOrderNo);
    }

    @Override
    public List<String> querySaleReturnDetailOrderNoByOrderNo(List<String> orderNos) {
        return saleReturnDetailOrderService.querySaleReturnDetailOrderNoByOrderNo(orderNos);
    }

    @Override
    public Page<SaleReturnModeModel> pageQueryMode(SaleReturnOrderQueryModeRequest request) {
        return saleReturnOrderService.pageQueryMode(request);
    }
}